import json
dt={'b':2,'c':4,'a':6}
s1=json.dumps(dt)
s2=json.dumps(dt,sort_keys=True,indent=4)
print(s1)
#{"b": 2, "c": 4, "a": 6}
print(s2)
# {
#     "a": 6,
#     "b": 2,
#     "c": 4
# }